import React, { useState } from 'react';
import ReactDOM from 'react-dom/client';
const Text = () => <span>你好</span>;
const App = () => {
	const [num, setNum] = useState(0);

	const list =
		num % 2 === 0
			? [<li key={1}>1</li>, <li key={2}>2</li>, <li key={3}>3</li>]
			: [<li key={2}>3</li>, <li key={3}>2</li>, <li key={1}>1</li>];

	return <ul onClick={() => setNum((state) => ++state)}>{list}</ul>;
};
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
	<App />
);
